package com.amoyt.project.constants;

/**
 * Redis常量
 */
public class RedisConstants {
    public static final String LOGIN_CODE_KEY = "login:code:";
    /**
     * 贫困户编号
     */
    public static final String ICR_POVERTY_CODE = "icr:poverty:code";
    /**
     * 贫困户编号锁
     */
    public static final String ICR_POVERTY_CODE_LOCK = "icr:poverty:code-lock";
    public static final Long ICR_POVERTY_LOCK_TTL = 5L; //5秒

    public static final Long LOGIN_CODE_TTL = 2L;

    public static final Long LOGIN_USER_TTL = 30L;
    public static final String LOGIN_USER_KEY = "login:token:";
    /**
     * 管理员已登录缓存TTL 2h
     */
    public static final Integer LOGIN_ADMIN_TTL = 2;
    /**
     * 访客已登录缓存TTL 1h
     */
    public static final Integer LOGIN_VISITOR_TTL = 1;
    /**
     * 用户已登录缓存 管理员+访客
     */
    public static final String LOGIN_USER_KEY_PRE = "login:user:";
    /**
     * 注册的验证码
     */
    public static final String REGISTER_CODE_KEY = "register:code:";
    public static final Integer REGISTER_CODE_KEY_PRE_TTL = 5;

    public static final Long CACHE_NULL_TTL = 2L;

    public static final Long CACHE_SHOP_TTL = 30L;
    public static final String CACHE_SHOP_KEY = "cache:shop:";

    public static final String LOCK_SHOP_KEY = "lock:shop:";
    public static final Long LOCK_SHOP_TTL = 10L;

    public static final String SECKILL_STOCK_KEY = "seckill:stock:";
    public static final String BLOG_LIKED_KEY = "blog:liked:";
    public static final String FEED_KEY = "feed:";
    public static final String SHOP_GEO_KEY = "shop:geo:";
    public static final String USER_SIGN_KEY = "sign:";
    public static final String ICR_PROJECT_CODE_LOCK = "icr:project:code-key";
    public static final String ICR_PROJECT_CODE = "icr:project:code";
    public static final Long ICR_PROJECT_LOCK_TTL = 5L;

    public static final String CACHE_POVERTY_DATA = "cache:data:poverty";
    public static final String CACHE_USER_DATA = "cache:data:user";
    public static final String CACHE_ARTICLE_DATA = "cache:data:article";
    public static final String CACHE_PROJECT_DATA = "cache:data:project";
    public static final String CACHE_BACK_DATA = "cache:data:back";
    public static final Integer CACHE_DATA_TTL = 30; //数据存放-30分钟
}
